package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.domain.ConstructionPlanEntity;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.ConstructionPlanMapper;
import javax.annotation.Resource;
import com.ly.heart.service.IConstructionPlanService;

/**
 * 施工计划Service业务层处理
 * 
 * @author wutao
 * @date 2024-06-10
 */
@Service
public class ConstructionPlanServiceImpl extends ServiceImpl<ConstructionPlanMapper, ConstructionPlanEntity> implements IConstructionPlanService {

    @Resource
    private ConstructionPlanMapper constructionPlanMapper;

    /**
     * 查询施工计划
     * 
     * @param id 施工计划ID
     * @return 施工计划
     */
    @Override
    public ConstructionPlanEntity selectConstructionPlanById(String id)
    {
        return constructionPlanMapper.selectConstructionPlanById(id);
    }

    /**
     * 查询施工计划列表
     * 
     * @param constructionPlan 施工计划
     * @return 施工计划
     */
    @Override
    public List<ConstructionPlanEntity> selectConstructionPlanList(ConstructionPlanEntity constructionPlan)
    {
        return constructionPlanMapper.selectConstructionPlanList(constructionPlan);
    }

    /**
     * 新增施工计划
     * 
     * @param constructionPlan 施工计划
     * @return 结果
     */
    @Override
    public int insertConstructionPlan(ConstructionPlanEntity constructionPlan)
    {
        constructionPlan.setCreateTime(DateUtils.getNowDate());
        constructionPlan.setId(SnowflakeIdWorker.getInstance().nextStringId());
        return constructionPlanMapper.insertConstructionPlan(constructionPlan);
    }

    /**
     * 修改施工计划
     * 
     * @param constructionPlan 施工计划
     * @return 结果
     */
    @Override
    public int updateConstructionPlan(ConstructionPlanEntity constructionPlan)
    {
        constructionPlan.setUpdateTime(DateUtils.getNowDate());
        return constructionPlanMapper.updateConstructionPlan(constructionPlan);
    }

    /**
     * 批量删除施工计划
     * 
     * @param ids 需要删除的施工计划ID
     * @return 结果
     */
    @Override
    public int deleteConstructionPlanByIds(String[] ids)
    {
        return constructionPlanMapper.deleteConstructionPlanByIds(ids);
    }

    /**
     * 删除施工计划信息
     * 
     * @param id 施工计划ID
     * @return 结果
     */
    @Override
    public int deleteConstructionPlanById(String id)
    {
        return constructionPlanMapper.deleteConstructionPlanById(id);
    }
}
